package com.sqsf.jdk;
//代理类
//基于目标类额外执行内容
//jdk代理就是代理类实现相同的接口
public class Proxy  implements TargetInterFace{
    TargetInterFace target;

    public Proxy(TargetInterFace target) {
        this.target = target;
    }

    public void before(){
        System.out.println("之前执行");
    }
    public void after(){
        System.out.println("之后执行");
    }

    @Override
    public void run() {
        before();
        target.run();
        after();
    }
}
